﻿using genericity;
using genericity.协变;
using genericity.实战;

/*
MyClass<int> myClass = new MyClass<int>();

var num = myClass.Sum(1, 2);
Console.WriteLine(num);
myClass.Print();

// MyClass<Person>my = new MyClass<Users>();
// 只能通过泛型接口实现，实现协变
// 协变用的非常少，只有在做框架的时候，
IMyList1<Person> list = new MyListImp<Person>();
IMyList1<Person> list2 = new MyListImp<Users>();
*/




//Respository<Account> respository = new Respository<Account>();
// 对象关系映射（ORM框架）：C#中的实体对象与数据表进行以一一对应，就叫对象关系映射
// 微软自带一个功能更强大的ORM框架,EntityFramework Core
//respository.Add(new Account() { name="老刘",money=666.666});
//var account = respository.Select();
//Console.WriteLine(account.Count);
//respository.Update(new Account() { id = 4, name = "王五", money = 5000 });


// 根据id查找数据
//var data = respository.Get(4);
//Console.WriteLine($"nam={data.name},money={data.money}");

//respository.Delete(7);




// 实战
var dic = EnumHelper.ToDictionaryDescription<OrderStateEnum>();
foreach (var kvp in dic)
{
    Console.WriteLine($"key:{kvp.Key},value:{kvp.Value}");
}

